package edu.bvrcj.profile;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DemoMain {
   
  public static void main(String[] args) {
//    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
//    ctx.getEnvironment().setActiveProfiles("test");
//    ctx.register(DemoJavaConfig.class);
//    ctx.refresh();
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring-config/applicationContext.xml");
    ctx.getEnvironment().setActiveProfiles("prod");
    ctx.refresh();
    System.out.println(ctx.getEnvironment());
     
    HelloWorldBean helloWorld = ctx.getBean(HelloWorldBean.class);
    System.out.println(helloWorld.sayHello());
  }
}